package it.canraid.leaflet.view;

import it.canraid.leaflet.model.LinePill;
import it.canraid.leaflet.model.WordPill;
import it.canraid.leaflet.model.WritingPill;

import java.util.ArrayList;

import android.content.Context;
import android.util.AttributeSet;

public class ReadMessageView extends CreateMessageView {
    private ArrayList<WordPill> words = new ArrayList<WordPill>();
    private ArrayList<LinePill> lines = new ArrayList<LinePill>();

    public ReadMessageView(Context context, AttributeSet attrs) {
	super(context, attrs);
    }

    public ReadMessageView(Context context) {
	this(context, null);
    }

    protected int getAlphaBackground(int idView) {
	return 255;
    }

    protected WritingPill getWords() {
	WritingPill wp = new WritingPill();
	wp.prewords = words;
	return wp;
    }

    protected ArrayList<LinePill> getLines() {
	return lines;
    }

    public void refresh(ArrayList<WordPill> words, ArrayList<LinePill> lines) {
	if (words != null || lines != null) {
	    if (lines != null)
		this.lines = lines;

	    if (words != null)
		this.words = words;

	    invalidate();
	}
    }
}
